package org.mcclone.splitter;

import org.apache.commons.io.FilenameUtils;

import java.io.File;

/**
 * Created by McClone on 2017/10/21.
 */
public class DefaultFileNameStrategy implements FileNameStrategy {

    private String destDir;
    private FileNameGenerator generator;

    public DefaultFileNameStrategy(File srcFile, String destDir) {
        this.destDir = destDir;
        generator = new FileNameGenerator(srcFile.getName(), "_");
    }

    @Override
    public String generate() {
        return FilenameUtils.concat(destDir, generator.generate());
    }
}
